package StringTest;

public class test5 {
    public static void main(String[] args) {
        String num1="3";
        String num2="10";

        //1.将字符转成数字
        int intnum1=changeInt(num1);
        int intnum2=changeInt(num2);
        //System.out.println(intnum);

        //2.将两数相乘
        System.out.println(intnum1*intnum2);
    }
    public static int changeInt(String s){
        char[] arr=s.toCharArray();
        int num=arr[0]-'0';
        //System.out.println(num);
        for (int i = 1; i < arr.length; i++) {
            num=num*10+(arr[i]-'0');
        }
        return num;
    }
}
